<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class News extends CI_Controller {
	public function __construct(){
		parent::__construct();
		$this->load->helper('url');
		$this->load->helper('date');
		$this->load->model('app_model');
		$this->load->library('my_layout');
		$this->my_layout->setLayout('layout/layout');
	}
	public function index(){
		$today = date('Y-m-d',now());
		$data['khoahoc'] = $this->app_model->getNewsByDay($today);
		$this->my_layout->view('html/homev',$data);
	}
	public function showContent($id=null){
		
		$data = $this->app_model->getDetail($id);
		$this->my_layout->view('html/detailv',$data[0]);
	}
}